#include "cv_segment.h"
#include "cvxImage.h"
#include "image_draw.h"
#include <time.h>
#include <iostream>
#include "cvxDrawImage.h"

using namespace::std;

#if 0
int main()
{
	char *inputName = "test_image\\synthetic\\synthetic.tif";   //
	Mat image = cv::imread(inputName, 1);

	cv::imshow("original image", image);
	Mat labelImage;
	int labelN = 0;
	double tt = clock();
	CvSegment::segment(image, labelImage, labelN, 0.5, 500, 400);
	fprintf(stderr, "cost time = %f\n", clock() - tt);

	CvxDrawImage::drawLabel(labelImage, labelN, true);

	cvWaitKey(0);
	return 1;
}
#endif

#if 0
int main()
{
	//58
	//34
	//29
	//36.png
	char *inputName = "test_image\\turtule\\left\\img_0001.png";   //
	IplImage *orgImage = cvLoadImage(inputName, 1);
	assert(orgImage);
	int labelN = 0;
	IplImage *outImage = NULL;
	double tt = clock();
	CvSegment::segment(orgImage, outImage, &labelN, 0.5, 500, 400);
	fprintf(stderr, "cost time = %f\n", clock() - tt);

	IplImage *hsvImage = NULL;
	ImageDraw::randColorPaint_malloc(outImage, labelN, hsvImage);
	

	cvShowImage("out", outImage);
	cvShowImage("hsv", hsvImage);
	cvShowImage("org", orgImage);
	cvWaitKey(0);
	return 1;
}
#endif
